package readtreefromfile;

import java.util.List;

public abstract class TreeParser {
	IRetrieveData retrieveData;
	IParseCategory parseCategory;
	
	public List<String> getData() throws Exception{
		return retrieveData.retrieve();
	}
	
	public Category parseCat(String tmp){
		return parseCategory.parseCat(tmp);
	}
	
	public void output(Category cat){
		StringBuffer space=new StringBuffer("");
		for(int i=0;i<cat.getLevel();i++){
			space.append(' ');
		}
		System.out.println(space+cat.getCatName());
		for(Category cattmp : cat.getChildren()){
			output(cattmp);
		}
	}

}
